const state = {
  // 是否在app中使用
  isInnerApp: /uotta/i.test(navigator.userAgent),
  wechatAppId: 'wxddcf96656b30a2f4',
  deviceInfo: {},
  airport: null,
  hospital: null,
  school: null,
  center: null
}

const mutations = {
  SET_DEVICE_INFO: (state, data) => {
    state.deviceInfo = data
  },
  SET_AIRPORT_STATUS: (state, data) => {
    state.airport = data
  },
  SET_HOSPITAL_STATUS: (state, data) => {
    state.hospital = data
  },
  SET_SCHOOL_STATUS: (state, data) => {
    state.school = data
  },
  SET_CENTER_STATUS: (state, data) => {
    state.center = data
  },
}

const actions = {
  setDeviceInfo ({ commit }, data) {
    commit('SET_DEVICE_INFO', data)
  },
  setAirportStatus ({ commit }, data) {
    commit('SET_AIRPORT_STATUS', data)
  },
  setHospitalStatus ({ commit }, data) {
    commit('SET_HOSPITAL_STATUS', data)
  },
  setSchoolStatus ({ commit }, data) {
    commit('SET_SCHOOL_STATUS', data)
  },
  setCenterStatus ({ commit }, data) {
    commit('SET_CENTER_STATUS', data)
  },

}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
